@use "../variables" as *;

.account-page {
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  margin: 0 auto;
  min-width: min-content;
  max-width: $chat-width;
  width: 100%;
}

.profile-container {
  width: 100%;
  margin: 0 auto;

  .login-section-title {
    display: flex;
    align-items: flex-start;
    margin-bottom: 34px;
    position: relative;
    margin: 0;
    font-size: 28px;
  }

  .login-section-description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-weak);
    margin: 16px 0 20px 0;
  }

  .login-section-button-group {
    display: flex;
    gap: 15px;
  }

  .profile-section {
  }

  .profile-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 34px;
    font-size: 20px;
    font-weight: 600;
    line-height: 36px;

    h1 {
      margin: 0;
      font-size: 28px;
    }
  }

  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 17px;
    font-weight: 700;
    height: 34px;

    .section-title {
      display: flex;
      align-items: center;
      gap: 8px;
    }
  }

  .user-info {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .avatar {
    min-width: 80px;
    min-height: 80px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .user-details {
    flex: 1;
  }

  .user-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 30px;
  }

  .user-edit-btn {
    display: flex;
    align-items: center;
    width: 36px;
    height: 36px;
    padding: 4px 7px;
    border-radius: 50%;
    cursor: pointer;
    white-space: nowrap;
    background: transparent;
    border: none;
    color: var(--text-weak);
    transition: background $transition-fast ease-in-out;

    &:hover {
      background: var(--bg-gray-medium);
    }

    &:focus {
      outline: none;
    }
  }

  .user-email {
    color: var(--text-weak);
  }

  .analytics-btn {
    background-color: var(--bg-gray-strong);
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
  }

  .analytics-btn:hover {
    background-color: var(--bg-gray-medium);
  }

  .plan-section {
    padding: 24px;
    margin-top: 20px;
    background-color: var(--bg-gray-op-medium);
    border-radius: 10px;
  }

  .plan-details {
    width: 100%;
  }

  .plan-badge {
    color: var(--text-pri);
    font-size: 30px;
    font-weight: 600;
    margin-bottom: 5px;
  }

  .subscription-info {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .info-label {
    color: var(--text-weak);
  }

  .info-value {
    font-weight: 600;
  }

  .progress-wrapper {
    margin: 16px 0;
  }

  .progress-container {
    height: 8px;
    background-color: var(--bg-gray-medium);
    border-radius: 4px;
    overflow: hidden;
    flex: 1;
  }

  .progress-bar {
    height: 100%;
    background-color: var(--bg-pri-strong);
    border-radius: 4px;
    width: 0%;
  }

  .progress-row {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .usage-details {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    white-space: nowrap;

    .usage-color-circle {
      width: 11px;
      height: 11px;
      border-radius: 50%;
      margin-right: 5px;

      &.model {
        background-color: var(--bg-pri-strong);
      }

      &.mcp {
        background-color: var(--bg-pri-weak);
      }
    }
  }

  .usage-details-value {
    font-weight: 600;
    margin-left: 5px;

    &:not(:last-child) {
      margin-right: 10px;
    }
  }

  .warning {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-pri-ultraweak);
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;

    .warning-icon {
      fill: var(--stroke-pri-strong);
      font-size: 20px;
    }

    &.on-limit {
      background-color: var(--bg-warning-weak);

      .warning-icon {
        fill: var(--stroke-warning);
      }
    }
  }

  .warning-text {
    color: var(--text-medium);
    font-size: 15px;
    flex: 1;

    .warning-text-title {
      font-weight: 700;
    }

    .plan-link {
      cursor: pointer;
      text-decoration: underline;
    }
  }
}

.oap-logout-btn {
  margin-top: 20px;
}